Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [linux] [opengl] Use RTLD_LOCAL to prevent LLVM symbol conflict with GLX #1326

Merged
merged 1 commit into from
Jun 25, 2020

Conversation

archibate
Copy link
Collaborator

Related issue = close #958 close #1100 close #1106 close #1113 close #1325

[Click here for the format server]


Specifying RTLD_GLOBAL will expose Taichi-customized LLVM symbols to other modules that may depends on other LLVM versions, e.g. GLX depends on LLVM and cause the issues above.

@Eydcao @TroyZhai This issue is finally solved systematically!!! Please confirm that if this PR works when you have time :)

@codecov
Copy link

codecov bot commented Jun 25, 2020

Codecov Report

Merging #1326 into master will decrease coverage by 0.46%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1326      +/-   ##
==========================================
- Coverage   85.35%   84.89%   -0.47%     
==========================================
  Files          19       19              
  Lines        3374     3237     -137     
  Branches      630      630              
==========================================
- Hits         2880     2748     -132     
+ Misses        362      357       -5     
  Partials      132      132              
Impacted Files Coverage Δ
python/taichi/lang/expr.py 89.24% <100.00%> (-0.52%) ⬇️
python/taichi/lang/ast_checker.py 70.58% <0.00%> (-1.64%) ⬇️
python/taichi/lang/ops.py 91.32% <0.00%> (-1.52%) ⬇️
python/taichi/lang/linalg.py 89.33% <0.00%> (-0.67%) ⬇️
python/taichi/lang/matrix.py 90.03% <0.00%> (-0.65%) ⬇️
python/taichi/lang/meta.py 61.90% <0.00%> (-0.60%) ⬇️
python/taichi/lang/impl.py 89.76% <0.00%> (-0.30%) ⬇️
python/taichi/lang/__init__.py 75.07% <0.00%> (-0.29%) ⬇️
python/taichi/lang/snode.py 85.86% <0.00%> (-0.16%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13462ff...3aff448. Read the comment docs.

Copy link
Member

@k-ye k-ye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (with no way to verify..)!

@masahi
Copy link
Contributor

masahi commented Jun 25, 2020

This fixed the same error on my end with opengl enabled. Thanks!

Copy link
Member

@yuanming-hu yuanming-hu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't clearly remember why I added RTLD_GLOBAL here, but let's see if everything works :-) Thanks.

@archibate archibate added the LGTM label Jun 25, 2020
@archibate archibate merged commit 0a434d3 into taichi-dev:master Jun 25, 2020
@Eydcao
Copy link
Contributor

Eydcao commented Jun 26, 2020

LGTM (with no way to verify..)!

I could verify this on my end, just a sec.

@Eydcao
Copy link
Contributor

Eydcao commented Jun 26, 2020

Unfortunately, sth is still going wrong on my end. Please see the log below

[Taichi] mode=development
[Taichi] preparing sandbox at /tmp/taichi-qe4n7sb9
[Taichi] <dev mode>, llvm 8.0.1, commit 3aff448e, python 3.8.2
[Taichi] Starting on arch=opengl
[E 06/26/20 12:19:59.619] [opengl_api.cpp:link@168] [glsl] error while linking program:
error: Too many compute shader storage blocks (11/8)



***********************************
* Taichi Compiler Stack Traceback *
***********************************
/tmp/taichi-qe4n7sb9/taichi_core.so: taichi::Logger::error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)
/tmp/taichi-qe4n7sb9/taichi_core.so: taichi::lang::opengl::GLProgram::link() const
/tmp/taichi-qe4n7sb9/taichi_core.so: taichi::lang::opengl::CompiledKernel::CompiledKernel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, taichi::lang::opengl::KernelParallelAttrib const&)
/tmp/taichi-qe4n7sb9/taichi_core.so: taichi::lang::opengl::CompiledProgram::Impl::add(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, taichi::lang::opengl::KernelParallelAttrib&&)
/tmp/taichi-qe4n7sb9/taichi_core.so(+0x9ea906) [0x7ff0eeb0d906]
/tmp/taichi-qe4n7sb9/taichi_core.so(+0x9dfc7b) [0x7ff0eeb02c7b]
/tmp/taichi-qe4n7sb9/taichi_core.so: taichi::lang::opengl::OpenglCodeGen::gen()
/tmp/taichi-qe4n7sb9/taichi_core.so: taichi::lang::opengl::OpenglCodeGen::compile(taichi::lang::Program&, taichi::lang::Kernel&)
/tmp/taichi-qe4n7sb9/taichi_core.so: taichi::lang::Program::compile(taichi::lang::Kernel&)
/tmp/taichi-qe4n7sb9/taichi_core.so: taichi::lang::Kernel::compile()
/tmp/taichi-qe4n7sb9/taichi_core.so: taichi::lang::Kernel::operator()()
/tmp/taichi-qe4n7sb9/taichi_core.so(+0x793dc9) [0x7ff0ee8b6dc9]
/tmp/taichi-qe4n7sb9/taichi_core.so(+0x6ef07e) [0x7ff0ee81207e]
/usr/bin/python3: PyCFunction_Call
/usr/bin/python3: _PyObject_MakeTpCall
/usr/bin/python3: ) [0x508530]
/usr/bin/python3: PyObject_Call
/usr/bin/python3: ) [0x597e3c]
/usr/bin/python3: _PyObject_MakeTpCall
/usr/bin/python3: _PyEval_EvalFrameDefault
/usr/bin/python3: _PyEval_EvalCodeWithName
/usr/bin/python3: _PyFunction_Vectorcall
/usr/bin/python3: PyObject_Call
/usr/bin/python3: _PyEval_EvalFrameDefault
/usr/bin/python3: _PyEval_EvalCodeWithName
/usr/bin/python3: _PyFunction_Vectorcall
/usr/bin/python3: _PyObject_FastCallDict
/usr/bin/python3: _PyObject_Call_Prepend
/usr/bin/python3: ) [0x597e17]
/usr/bin/python3: PyObject_Call
/usr/bin/python3: _PyEval_EvalFrameDefault
/usr/bin/python3: _PyEval_EvalCodeWithName
/usr/bin/python3: _PyFunction_Vectorcall
/usr/bin/python3: _PyEval_EvalFrameDefault
/usr/bin/python3: _PyFunction_Vectorcall
/usr/bin/python3: _PyEval_EvalFrameDefault
/usr/bin/python3: _PyEval_EvalCodeWithName
/usr/bin/python3: PyEval_EvalCode
/usr/bin/python3: ) [0x676101]
/usr/bin/python3: ) [0x67617f]
/usr/bin/python3: PyRun_FileExFlags
/usr/bin/python3: PyRun_SimpleFileExFlags
/usr/bin/python3: Py_RunMain
/usr/bin/python3: Py_BytesMain
/lib/x86_64-linux-gnu/libc.so.6: __libc_start_main
/usr/bin/python3: _start

Internal Error occurred, check this page for possible solutions:
https://taichi.readthedocs.io/en/stable/install.html#troubleshooting
/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import fnmatch, glob, traceback, errno, sys, atexit, locale, imp
Traceback (most recent call last):
  File "/home/yadicao/Desktop/taichi/examples/fractal.py", line 30, in <module>
    gui.set_image(pixels)
  File "/home/yadicao/Desktop/taichi/python/taichi/misc/gui.py", line 91, in set_image
    tensor_to_image(img, self.img)
  File "/home/yadicao/Desktop/taichi/python/taichi/lang/kernel.py", line 528, in wrapped
    return primal(*args, **kwargs)
  File "/home/yadicao/Desktop/taichi/python/taichi/lang/kernel.py", line 460, in __call__
    return self.compiled_functions[key](*args)
  File "/home/yadicao/Desktop/taichi/python/taichi/lang/kernel.py", line 424, in func__
    t_kernel()
RuntimeError: [opengl_api.cpp:link@168] [glsl] error while linking program:
error: Too many compute shader storage blocks (11/8)

@archibate
Copy link
Collaborator Author

@Eydcao note that the error message is changed, so you actually encountered another issue, I know why this occur and will fix later.

@Eydcao
Copy link
Contributor

Eydcao commented Jun 26, 2020

Yeah this time at least compute shade appears. So it has reached the glx with the correct llvm version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants